package com.taropan.wallpaper.util;

import java.lang.ref.WeakReference;

import android.content.Context;

/**
 * 全局类
 * 
 * @author taro
 * 
 */
public class AppContext {

	private static AppContext instance = new AppContext();

	public static AppContext getInstance() {
		if (instance == null) {
			instance = new AppContext();
		}
		return instance;
	}

	/**
	 * 获取 系统上下文
	 */
	private WeakReference<Context> context;

	/**
	 * 获取 系统上下文
	 * 
	 * @return
	 */
	public static Context getContext() {
		if (getInstance().context == null) {
			return null;
		}
		return getInstance().context.get();
	}

	/**
	 * 设置 系统上下文
	 * 
	 * @return
	 */
	public static void setContext(Context contextx) {
		getInstance().context = null;
		getInstance().context = new WeakReference<Context>(contextx);
	}

	
	public static final String SD_PATH = "wallpaper";
	
	

}
